'''Layers that you can add to a scene that will block input to
other event handlers.

XXX this doesn't work
'''

from cocos import tiles, layer

class Modal(object):
    is_event_handler = True

    def on_mouse_press(self, *args): return True

    on_mouse_release = on_mouse_press
    on_mouse_motion = on_mouse_press
    on_mouse_drag = on_mouse_press
    on_key_press = on_mouse_press
    on_text = on_mouse_press
    on_text_motion = on_mouse_press
    on_text_motion = on_mouse_press

class ModalLayer(layer.Layer, Modal):
    pass

class ScrollableModalLayer(tiles.ScrollableLayer, Modal):
    pass

